﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class RefOut
    {
        public void Ru(int[] arr, ref int sum, ref int max, ref int min, ref double avg)
        {
            for (int i = 0; i < arr.Length; i++)
            {
                sum += arr[i];
                if (max < arr[i])
                {
                    max = arr[i];
                }
                if (min > arr[i])
                {
                    min = arr[i];
                }
            }
            avg = sum * 1.0 / arr.Length;
        }
        public void Ru1(int[] arr, out int sum, out int max, out int min, out double avg)
        {
            sum = 0;
            max = arr[0];
            min = arr[0];
            avg = arr[0];
            for (int i = 0; i < arr.Length; i++)
            {
                sum += arr[i];
                if (max < arr[i])
                {
                    max = arr[i];
                }
                if (min > arr[i])
                {
                    min = arr[i];
                }
            }
            avg = sum * 1.0 / arr.Length;
        }
    }
}
